
cmake_minimum_required(VERSION 3.20)

project(lukv VERSION 1.0.0)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED true)

if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
    add_subdirectory(test)
endif ()

if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tmp/CMakeLists.txt")
    add_subdirectory(tmp)
endif ()

file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/src/*/*.h")
file(GLOB sources "${CMAKE_CURRENT_SOURCE_DIR}/src/*/*.cpp")

set(EXECS ${headers} ${sources})

add_executable(${PROJECT_NAME}_cli  "${CMAKE_CURRENT_SOURCE_DIR}/src/client.cpp")
add_executable(${PROJECT_NAME}_srv ${EXECS} "${CMAKE_CURRENT_SOURCE_DIR}/src/server.cpp")
add_executable(${PROJECT_NAME}_cluster ${EXECS} "${CMAKE_CURRENT_SOURCE_DIR}/src/cluster.cpp")

